-
Notifications
You must be signed in to change notification settings - Fork 61
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add pipelining API documentation #226
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Feedback
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just a bunch of nitpicks and typos
Co-authored-by: Andreas Wallner <[email protected]>
|
||
val PC = Payload(UInt(32 bits)) | ||
n0(PC) := 0x42 | ||
n0(PC, "true") := 0x42 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So is the above two lines represent different signals?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes
n0_PC
n0_PC_true
|
||
* - API | ||
- Description | ||
* - node.setAlwaysValid() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We have setIdle and setBlocked in Stream, if we need to provide a setAlwaysXXXX style function to keep consistency to lower study curve.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It isn't realy the same use case.
setAlwaysValid isn't just valid := True, but also mean that the valid signal is always high in a static way, will never be False ever.
while setIdle is used to provide a value which can be overriden.
Still any sugestion for better API name is welcome :D
val c01 = StageLink(n0, n1) | ||
|
||
|
||
S2mLink |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So there are three types of link to represent the different Link strategy. How about add an apply function for the Link class and create different XXXLink by parameters. So that the code can be unchanged while Link type changing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure, this can be added as an tool on the top of the existing API. I didn't focussed much on that part of things yet
* - throwWhen(Bool) | ||
- Allows to cancel the current transaction from the pipeline (clear down.valid and c the transaction driver) | ||
* - forgetOneWhen(Bool) | ||
- Allows to request the upstream to forget the current transaction (but doesn't clear the down.valid) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What does the forget mean here, it will cancel the upstream's current transaction?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, i'm replacing "the current" by "its current"
- Allows to cancel the current transaction from the pipeline (clear down.valid and c the transaction driver) | ||
* - forgetOneWhen(Bool) | ||
- Allows to request the upstream to forget the current transaction (but doesn't clear the down.valid) | ||
* - ignoreReadyWhen(Bool) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This name is hard to understand for me. What the purpose for this? I guess it is to hang on the downstream transaction and fire upstream's?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
forgetOneWhen ?
It will not hang anything, just make the upstream transaction driver "forget" about its current state.
That's a light weight to flush / remove something from the pipeline without having to manipulate the ready wire
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
forgetOneWhen ? It will not hang anything, just make the upstream transaction driver "forget" about its current state. That's a light weight to flush / remove something from the pipeline without having to manipulate the ready wire
i mean the ignoreReadyWhen
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ahhh. it is to fire the upstream.
It doesn't hang downstream
Its usage is to implement some logic to flush / remove elements of a pipeline.
You can do that for instance by combining ignoreReadyWhen and terminateWhen
* - ignoreReadyWhen(Bool) | ||
- Allows to ignore the downstream ready (set up.ready) | ||
* - duplicateWhen(Bool) | ||
- Allows to duplicate the current transaction (clear up.ready) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this mean split one transaction into two?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, it alows the transaction to eventualy duplicate downstream while holding a copy in the current node.
WIP
Document SpinalHDL/SpinalHDL#1237